

package com.dog.basics.bean.vo.admin.sys;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 菜单权限表
 * </p>
 *
 * @author guonh
 * @since 2017-11-08
 */
@Data
@ApiModel(value = "菜单展示对象")
public class AdminMenuVO implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 菜单ID
	 */
	@ApiModelProperty(value = "菜单id", dataType = "Long")
	private Long menuId;

	/**
	 * 菜单名称
	 */
	@ApiModelProperty(value = "菜单名称", dataType = "String")
	private String name;

	/**
	 * 菜单权限标识
	 */
	@ApiModelProperty(value = "菜单权限标识", dataType = "String")
	private String permission;

	/**
	 * 父菜单ID
	 */
	@ApiModelProperty(value = "父菜单id", dataType = "Long")
	private Long parentId;

	/**
	 * 图标
	 */
	@ApiModelProperty(value = "图标", dataType = "String")
	private String icon;

	/**
	 * 前端路由标识路径
	 */
	@ApiModelProperty(value = "前端路由标识路径", dataType = "String")
	private String path;

	/**
	 * 排序值
	 */
	@ApiModelProperty(value = "排序值", dataType = "Integer")
	private Integer sort;

	/**
	 * 菜单类型 （0菜单 1按钮）
	 */
	@ApiModelProperty(value = "菜单类型,0:菜单 1:按钮", dataType = "String")
	private String type;

	/**
	 * 是否缓冲
	 */
	@ApiModelProperty(value = "路由缓冲", dataType = "String")
	private String keepAlive;

	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间", dataType = "Long")
	private Long createTime;

	/**
	 * 更新时间
	 */
	@ApiModelProperty(value = "更新时间", dataType = "Long")
	private Long updateTime;

	/**
	 * 0--正常 1--删除
	 */
	@ApiModelProperty(value = "删除标记,1:已删除,0:正常", dataType = "String")
	private Integer delFlag;

	@Override
	public int hashCode() {
		return menuId.hashCode();
	}

	/**
	 * menuId 相同则相同
	 * @param obj
	 * @return
	 */
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof AdminMenuVO) {
			Long targetMenuId = ((AdminMenuVO) obj).getMenuId();
			return menuId.equals(targetMenuId);
		}
		return super.equals(obj);
	}

}
